package org.alex.samples.file;

import java.security.MessageDigest;
import sun.misc.BASE64Encoder;

public class MD5Utils {
	
	public static String GetMD5Code(String strObj) throws Exception{
		MessageDigest md = MessageDigest.getInstance("MD5");
		byte[] temp = md.digest(strObj.getBytes());
		BASE64Encoder encode = new BASE64Encoder();
		return encode.encode(temp);
	}

	public static void main(String[] a) throws Exception{
		System.out.println(MD5Utils.GetMD5Code("123456"));
	}
}
